Release 10.1A: OpenEdge Data Management:
SQL Reference
GRANT
Grants various privileges to the specified users of the database. There are two forms of the
GRANTstatement:
- Grant database-wide privileges, such as system administration (
DBA), general creation (RESOURCE), audit administration (AUDIT_ADMIN), audit archive (AUDIT_ARCHIVE), or audit insert (AUDIT_INSERT).- Grant various privileges on specific tables and views. Privilege definitions are stored in the system tables
SYSDBAUTH,SYSTABAUTH, andSYSCOLAUTHfor the database, tables, and columns, respectively.This is the syntax to
GRANTdatabase-wide privileges:Syntax
Example
In this example, audit administration and audit archive privileges are granted to bsmith:
Because these privileges are granted to bsmith
WITH GRANT OPTION, bsmith may now grant these two privileges to other users.This is the syntax to
GRANTprivileges on specific tables and views:Syntax
This is the syntax for theprivilegevariable:
Use the following syntax to assign sequence privileges:
SELECTAllows specified user to read data from the sequence.
UPDATEAllows specified user to modify data for the sequence.
ExampleIn this example, the sequence generator grants user slsadmin the ability to modify the customer number sequence.
The following syntax is a variation on the
GRANTstatement that enables the user to execute stored Java procedures:Syntax
RESOURCEAllows the specified users to issue
CREATEstatements.DBAAllows the specified users to create, access, modify, or delete any database object, and to grant other users any privileges.
TO username [ , username ] , ...Grants the specified privileges on the table or view to the specified list of users.
SELECTAllows the specified users to read data from the table or view.
INSERTAllows the specified users to add new rows to the table or view.
DELETEAllows the specified users to delete rows from the table or view.
INDEXAllows the specified users to create an index on the table or view.
UPDATE [ ( column , column , ... ) ]Allows the specified users to modify existing rows in the table or view. If followed by a column list, the users can modify values only in the columns named.
REFERENCES [ ( column , column , ... ) ]Allows the specified users to refer to the table from other tables’ constraint definitions. If followed by a column list, constraint definitions can refer only to the columns named.
Note: For more detail on constraint definitions, see the Column constraints and Table constraints entries of this section.ALLGrants all privileges for the table or view.
TO PUBLICGrants the specified privileges on the table or view to any user with access to the system.
WITH GRANT OPTIONAllows the specified users to grant their privileges or a subset of their privileges to other users.
Example
Note: If the username specified in a
RESOURCEorDBA GRANToperation does not already exist, theGRANTstatement creates a row in theSYSDBAUTHsystem table for the new username. This row is not deleted by a subsequentREVOKEoperation.Authorization
Must have the
DBAprivilege, ownership of the table, or all the specified privileges on the table (granted with theWITH GRANT OPTIONclause). Must have theDBAprivilege orAUDIT_ADMIN WITH GRANTprivilege to grant auditing privileges.Related statements
REVOKE
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |